package deviceScript

import (
	"gitee.com/fierce_wolf/go-fox-edge-common/commRedisService"
	"gitee.com/fierce_wolf/go-fox-edge-common/edgeEntity"
)

type ScriptEngineInitialize struct {
}

func (e *ScriptEngineInitialize) Initialize(routineKey string) {
	operateList, _ := commRedisService.IRedisManager.GetEntityMap(edgeEntity.Type.OperateEntity.Type())
	for _, entity := range operateList {
		value := entity.(*edgeEntity.OperateEntity)

		notify.routineKeys.Store(routineKey, nil)
		notify.RebindScriptEngine(routineKey, value)
	}

	redisService := commRedisService.IRedisManager.GetRedisService(edgeEntity.Type.OperateEntity.Type())
	redisService.SetTypeNotify(notify)
}
